$(function(){

		$(document).click(function(e){
			var $select = $(".emotion");
			var $changyong = $(".sentence-panel");
			var $jianli =  $(".panel-resume");
			var $phone = $(".panel-contact");
			var $wechat = $(".panel-wechat");
			//判断事件对象不是弹窗对象  并且  弹窗对象不包含事件对象
			if (!$select.is(e.target) && $select.has(e.target).length == 0) {
						$(".emotion").attr("style","display: none;");
			}
			if (!$changyong.is(e.target) && $changyong.has(e.target).length == 0) {
						$(".sentence-panel").attr("style","display: none;");
			}	
			if (!$jianli.is(e.target) && $jianli.has(e.target).length == 0) {
						$(".panel-resume").attr("style","display: none;");
			}	
			if (!$phone.is(e.target) && $phone.has(e.target).length == 0) {
						$(".panel-contact").attr("style","display: none;");
			}
			if (!$wechat.is(e.target) && $wechat.has(e.target).length == 0) {
						$(".panel-wechat").attr("style","display: none;");
			}
})

	//表情
	$(".btn-emotion").click(function(e){
		e.stopPropagation();
		var biaoqing = $(".emotion").attr("style");
		if(biaoqing != ""){
			$(".emotion").attr("style","");
			$(".sentence-panel").hide();
			$(".sentence-popover").hide();
		}else{
			$(".emotion").attr("style","display: none;");
		}
	})
	
	//	常用语
	$(".btn-dict").click(function(e){
		e.stopPropagation();
		var changyong = $(".sentence-panel").attr("style");
		if(changyong != ""){
			$(".sentence-panel").attr("style","");
			$(".emotion").hide();
			$(".sentence-popover").hide();
		}else{
			$(".sentence-panel").attr("style","display: none;");
		}
	})
	
	//	发简历
	$(".btn-resume").click(function(e){
		e.stopPropagation();
		var jianli = $(".panel-resume").attr("style");
		if(jianli != ""){
			$(".panel-resume").attr("style","");
			$(".emotion").hide();
			$(".sentence-panel").hide();
			$(".panel-contact").hide();
			$(".panel-wechat").hide();
		}else{
			$(".panel-resume").attr("style","display: none;");
		}
		
		$(".panel-resume .btn-cancel").click(function(){
			$(".panel-resume").attr("style","display: none;");
			return;
		})
	})
	
	//交换手机
	$(".btn-contact").click(function(e){
		e.stopPropagation();
		var phone = $(".panel-contact").attr("style");
		if(phone != ""){
			$(".panel-contact").attr("style","");
			$(".emotion").hide();
			$(".sentence-panel").hide();
			$(".panel-resume").hide();
			$(".panel-wechat").hide();
		}else{
			$(".panel-contact").attr("style","display: none;");
		}
		
		$(".panel-contact .btn-cancel").click(function(){
			$(".panel-contact").attr("style","display: none;");
			return;
		})
	})
	
	//交换微信
		$(".btn-weixin").click(function(e){
		e.stopPropagation();
		var wechat = $(".panel-wechat").attr("style");
		if(wechat != ""){
			$(".panel-wechat").attr("style","");
			$(".emotion").hide();
			$(".sentence-panel").hide();
			$(".panel-resume").hide();
			$(".panel-contact").hide();
		}else{
			$(".panel-wechat").attr("style","display: none;");
		}
		
		$(".panel-wechat .btn-cancel").click(function(){
			$(".panel-wechat").attr("style","display: none;");
			return;
		})
		
		
	})
		
		$(".user-list li").click(function(e){
			e.stopPropagation();
			
			$(this).attr("class","selected").siblings().attr("class","");
		})
		
//		$(".op-settop").toggle(
//			function(){
//				$(this).attr("class","op-settop tooltip tooltip-top selected");
//				$(".user-list li[class='selected']").attr("class","selected user-top");
//		
//			},
//			function(){
//				$(this).attr("class","op-settop tooltip tooltip-top");
//			}
//		)
})
	